<!--{include admin/top.html}-->
	<div class="mainPage">
	<!--{if $do =='list'}-->
		<h1 class="title">模板列表
			<span class='sub_menu'>
				&nbsp; <a href="{:parse_uri('admin_other-ptpl-do-add')}">添加模板</a>
			</span>
		</h1>
		<table width="100%" align=center cellspacing=0 cellpadding=0 border=0>
		<tr >
			<td width="15%" align=center>
				<p><b>模板名称</b></p></td>
			<td width="10%" align=center><p><b>操作</b></p></td>
		</tr>
		<!--{foreach $pts $k $v}-->
		<tr class='ctr'>
			<td align=center>
				<p style="line-height:20px;">{$v['cname']}</p>
			</td>
			<td  align=center>
				<p>
				<a href="{:parse_uri('admin_other-ptpl-do-modify-id-%d',$v['Id'])}">修改</a>
				<a href="{:parse_uri('admin_other-ptpl-do-del-id-%d',$v['Id'])}" onclick="return confirm('确定删除?')">删除</a>
				</p>
			</td>
		</tr>
		<!--{/foreach}--></table>
	<!--{elseif $do == 'add' || $do == 'modify'}-->
	<script>
	function addAttr(){
		var str = '<p>属性: <input name="attr[]" value="{$v}" class="ipt"/> <a href="javascript:void(0)" onclick="rmAttr(this)">移除</a></p>';
		$("#attrDIV").append(str);
		$("#attrDIV input:first-child").focus();
	}
	function rmAttr(obj){
		$(obj).parent().empty();
	}
	</script>
		<h1 class="title">
			<!--{if $do == 'add'}-->添加模板<!--{else}-->修改模板<!--{/if}-->
			<span class='sub_menu'>
				&nbsp; <a href="{:parse_uri('admin_other-ptpl-do-list')}">返回列表</a>
			</span>
		</h1>
		<form action="{:parse_uri('admin_other-ptpl-do-save')}" method="post">
		<input type="hidden"  name="Id" value="{$ptpl['Id']}" />
		<div id="attrDIV">
		<p>名称: <input name="cname" id="cname" value="{$ptpl['cname']}" class="ipt"/></p>
		{foreach $ptpl['tpl'] $k $v}
		<p>属性: <input name="attr[]" value="{$v}" class="ipt"/> <a href="javascript:void(0)" onclick="rmAttr(this)">移除</a></p>
		{/foreach}
		</div>
		<p style='margin-top:10px;'>
			<input type="submit" value='提交'class="submit"/>
			<A href="javascript:void(0)" onclick="addAttr()">添加属性</a>
			<A href="javascript:void(0)" onclick="location.reload()">重置属性</a>
		</p>
		</form>
	<!--{/if}-->
		<p>
			&nbsp;
		</p>
	</div>
</body>
</html>